﻿package frEngine.animateControler.particleControler.animate
{
    import flash.geom.*;
    import frEngine.math.*;

    public class ParticleItem extends Object
    {
        public var startRotate:Quaternion;
        public var startPos:Vector3D;
        private var _rotate:Quaternion;
        private var _pos:Vector3D;
        public var inertiaDirection:Vector3D;
        public var uOffset:Number = 0;
        public var vOffset:Number = 0;
        public var isPlaying:Boolean = true;
        public var fingerU:Number = 0;
        public var fingerV:Number = 0;
        public var index:int;
        public var aRotateAngle:Number;
        public var aRotateAngleOffset:Number;
        public var aRotateAxis:Vector3D;
        public var emmiteFrame:uint = 0;
        public var life:uint = 0;
        public var birthAtFrame:int = 2147483647;
        public var randomValue:Number = 0;
        public var lineSpeed:Vector3D;
        public var size:Number = 1;
        public var curFrame:int = -1;
        public var toUpdate:Boolean = true;
        public var lifeRate:Number = 0;
        public var visible:uint = 1;
        public var circle:int = -2;
        public var selfRotate:Quaternion;
        public var resultRotate2:Quaternion;
        public var resultPos:Vector3D;
        public var preResultPos:Vector3D;
        public var posOffset:Vector3D;

        public function ParticleItem()
        {
            this._rotate = new Quaternion();
            this._pos = new Vector3D();
            this.inertiaDirection = new Vector3D();
            this.aRotateAxis = new Vector3D();
            this.lineSpeed = new Vector3D();
            this.selfRotate = new Quaternion(0, 0, 0, 1);
            this.resultRotate2 = new Quaternion(0, 0, 0, 1);
            this.resultPos = new Vector3D();
            this.preResultPos = new Vector3D(0, 0, 0, -1);
            this.posOffset = new Vector3D();
            this.startRotate = this._rotate;
            this.startPos = this._pos;
            return;
        }// end function

        public function reinit(param1:Vector3D, param2:Quaternion, param3:Boolean) : void
        {
            this.preResultPos.w = -1;
            if (param3)
            {
                this.startPos = this._pos;
                this.startRotate = this._rotate;
                this.startPos.x = param1.x;
                this.startPos.y = param1.y;
                this.startPos.z = param1.z;
                this.startRotate.x = param2.x;
                this.startRotate.y = param2.y;
                this.startRotate.z = param2.z;
                this.startRotate.w = param2.w;
            }
            else
            {
                this.startPos = param1;
                this.startRotate = param2;
            }
            this.uOffset = this.fingerU;
            this.vOffset = this.fingerV;
            return;
        }// end function

        public function reset(param1:Boolean) : void
        {
            this.circle = -2;
            this.visible = 1;
            this.isPlaying = true;
            this.size = 1;
            this.birthAtFrame = int.MAX_VALUE;
            var _loc_2:int = 0;
            this.inertiaDirection.z = 0;
            var _loc_2:* = _loc_2;
            this.inertiaDirection.y = _loc_2;
            this.inertiaDirection.x = _loc_2;
            this.preResultPos.w = -1;
            if (this.selfRotate.w != 1)
            {
                var _loc_2:int = 0;
                this.selfRotate.z = 0;
                var _loc_2:* = _loc_2;
                this.selfRotate.y = _loc_2;
                this.selfRotate.x = _loc_2;
                this.selfRotate.w = 1;
            }
            if (param1)
            {
                this.fingerU = 0;
                this.fingerV = 0;
            }
            return;
        }// end function

    }
}
